<!DOCTYPE html>
<html>
{include file="public/head"}
<body>
    <div class="fly-panel">
	<form method="post" action="{:url('admin/problem/add_opt')}" class="layui-form layui-form-pane">
            <div class="layui-form-item" >
                <label class="layui-form-label">管理需知:</label>
                <div class="layui-input-block">
                    <a href="{:url('web/index/help_admin')}" target="_blank" class="layui-btn">点击查看</a>
                </div>
            </div>


		<div class="layui-form-item">
			<label class="layui-form-label">标题:</label>
			<div class="layui-input-block">
				<input type="text" name="title" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">时间限制:</label>
			<div class="layui-input-inline">
                            <input type="" name="time_limit" class="layui-input" value="1">
			</div>
			<div class="layui-form-mid layui-word-aux">S</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">空间限制:</label>
			<div class="layui-input-inline">
                            <input type="" name="memory_limit" class="layui-input" value="64">
			</div>
			<div class="layui-form-mid layui-word-aux">MB</div>
		</div>
		<div class="layui-form-item" style="margin-top: 20px;">
			<label class="layui-form-label">难度:</label>
			<div class="layui-input-block">
                            <input type="text" name="score" class="layui-input" placeholder="0~10">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">问题描述:</label>
			<textarea id="description" class='layui-hide' name="description"></textarea>
		</div>
		<div style="padding-bottom: 20px;" class="nyoj-clear-width">
                <div id='description-ed'></div> 
                </div>
            
            
		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">输入描述:</label>
			<textarea id="input" class="layui-textarea" name="input"></textarea>
		</div>		

		<div class="layui-form-item  layui-form-text">
			<label class="layui-form-label">输出描述:</label>
			<textarea id="output" class="layui-textarea" name="output"></textarea>
		</div>
		

		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">样例输入:</label>
			<div class="layui-input-block">
				<textarea id="sample_input" class="layui-textarea" name="sample_input"></textarea>
			</div>
		</div>
		
		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">样例输出:</label>
			<div class="layui-input-block">
				<textarea id="sample_output" class="layui-textarea" name="sample_output"></textarea>
			</div>
		</div>
		
		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">提示:</label>
				<textarea id="hint" class="layui-hide" name="hint"></textarea>
		</div>
                <div style="padding-bottom: 20px;" class="nyoj-clear-width">
                    <div id='hint-ed'></div> 
                </div>    
            
            
		<div class="layui-form-item" pane>
			<label class="layui-form-label">特判:</label>
			<div class="layui-input-block">
				<input type="radio" name="spj" value="1" title="是">
				<input type="radio" name="spj" value="0" title="否" checked>
			</div>
		</div>

		<div class="layui-form-item" pane>
			<label class="layui-form-label">是否公开:</label>
			<div class="layui-input-block">
				<input type="radio" name="defunct" value="N" title="是">
				<input type="radio" name="defunct" value="Y" title="否" checked>
			</div>
		</div>
		
		<div class="layui-form-item" style="margin-top: 20px;">
			<label class="layui-form-label">来源:</label>
			<div class="layui-input-block">
				<input type="text" name="source" class="layui-input">
			</div>
		</div>
		
		<div style="text-align: center;">
			<input type="submit" name="" value="提交" class="layui-btn" >
		</div>
	</form>
</div>
{include file="public/end"}
<script type="text/javascript" src="__STATIC__/WE/wangEditor.min.js"></script>
<script>
    
layui.use(['form','jquery'],function(){
    var $=layui.jquery;
    
    var E = window.wangEditor;  
        var editor = new E('#description-ed');
        editor.customConfig.uploadImgServer = '/api/uploadimage'; // 上传图片到服务器
        editor.customConfig.uploadImgMaxSize = 3 * 1024 * 1024;
        editor.customConfig.uploadFileName = 'file';
        var $text1 = $('#description');
        editor.customConfig.onchange = function (html) {
            // 监控变化，同步更新到 textarea
            $text1.val(html);
        };
        editor.customConfig.menus = [
        'head',  // 标题
    'bold',  // 粗体
    'fontSize',  // 字号
    'fontName',  // 字体
    'italic',  // 斜体
    'underline',  // 下划线
    'strikeThrough',  // 删除线
    'foreColor',  // 文字颜色
    'backColor',  // 背景颜色
    'link',  // 插入链接
    'list',  // 列表
    'justify',  // 对齐方式
    'quote',  // 引用
    'image',  // 插入图片
    'table',  // 表格
    'code',  // 插入代码
    'undo',  // 撤销
    'redo'  // 重复
    ];
        editor.create();
        $text1.val(editor.txt.html());
});
layui.use(['form','jquery'],function(){
    var $=layui.jquery;
    
    var E = window.wangEditor;  
        var editor = new E('#hint-ed');
        editor.customConfig.uploadImgServer = '/api/uploadimage'; // 上传图片到服务器
        editor.customConfig.uploadImgMaxSize = 3 * 1024 * 1024;
        editor.customConfig.uploadFileName = 'file';
        var $text1 = $('#hint');
        editor.customConfig.onchange = function (html) {
            // 监控变化，同步更新到 textarea
            $text1.val(html);
        };
        editor.customConfig.menus = [
        'head',  // 标题
    'bold',  // 粗体
    'fontSize',  // 字号
    'fontName',  // 字体
    'italic',  // 斜体
    'underline',  // 下划线
    'strikeThrough',  // 删除线
    'foreColor',  // 文字颜色
    'backColor',  // 背景颜色
    'link',  // 插入链接
    'list',  // 列表
    'justify',  // 对齐方式
    'quote',  // 引用
    'image',  // 插入图片
    'table',  // 表格
    'video',  // 插入视频
    'code',  // 插入代码
    'undo',  // 撤销
    'redo'  // 重复
    ];
        editor.create();
        $text1.val(editor.txt.html());
});
</script>
</html>